[stable32] fix(theming): fix broken custom images introduced by #58224#60233
[stable32] fix(theming): fix broken custom images introduced by #58224#60233backportbot[bot] wants to merge 7 commits into
Conversation
PR #58224 introduced a raster→SVG conversion path in ImageManager::getImage() that breaks display of custom theming images. The root cause is a three-part bug chain: 1. getImage() attempted to convert raster images (PNG/JPEG) to SVG format, which Imagick cannot do meaningfully and produces broken output. 2. getMimeType() returns 'application/octet-stream' for extensionless stored files, so the Content-Type response header was wrong. 3. Stale .svg cache files persisted after image replacement, causing subsequent requests to serve the wrong format. Fix by: - Restricting the Imagick conversion to SVG→PNG only (not raster→SVG) - Reading the stored MIME type from IAppConfig for extensionless files in ThemingController::getImage() - Deleting .svg cache files in ImageManager::delete() - Injecting IAppConfig into ImageManager and reading the cachebuster via IAppConfig::getAppValueInt() so the URL returned after upload always carries the freshly-incremented value (IConfig::getAppValue() can return a stale cached value within the same request) - Updating the FileInputField Vue component to use a reactive cacheKey ref that increments on every upload, so the thumbnail refreshes even when the MIME type of the new image is the same as the old one AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Anna Larch <anna@nextcloud.com>
- ImageManagerTest: inject IAppConfig mock, switch cachebuster assertions from IConfig::getAppValue to IAppConfig::getAppValueInt, add testGetImageSvgToSvg and testGetImageSvgToPng, update mockGetImage to reflect the corrected getImage() logic - ThemingControllerTest: update getImage and getManifest tests to use IAppConfig::getAppValueString for MIME type and cachebuster lookups, add testGetLogoOriginalFile for the extensionless-file MIME path AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Anna Larch <anna@nextcloud.com>
- Remove stale ThemingController entry (deprecated IConfig::getAppValue calls replaced with IAppConfig::getAppValueString) - Add CommentsEventListener::getEvent() (pre-existing deprecated usage not previously baselined) AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Anna Larch <anna@nextcloud.com>
- Remove stale ThemingController entry (deprecated IConfig::getAppValue calls replaced with IAppConfig::getAppValueString) - Add CommentsEventListener::getEvent(), Activity/Listener::getEvent(), and Notification/Listener::getEvent() (pre-existing deprecated usage not previously baselined) Signed-off-by: Anna Larch <anna@nextcloud.com> AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
IConfig has no use-import in Server.php; the rest of the file uses \OCP\IConfig::class directly. Signed-off-by: Anna Larch <anna@nextcloud.com> AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Psalm does not flag these as violations on stable32; the entries are not needed. Signed-off-by: Anna Larch <anna@nextcloud.com> AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The only difference I see is that |
|
@copilot please add the missing changes from #60198 - see @julien-nc's comment |
Agent-Logs-Url: https://github.com/nextcloud/server/sessions/3691de2e-c43a-4f08-b101-79cfe030dfa7 Co-authored-by: miaulalala <7427347+miaulalala@users.noreply.github.com>
Fixed in 42dc63b by backporting the missing
Added the missing backport changes from #60198 in commit 42dc63b, specifically for |
Backport of #60198
Warning, This backport's changes differ from the original and might be incomplete⚠️
Todo
Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.